# 包装程序，使用powershell进行后台运行

if ($(Test-Path ".\users.txt") -and $(Test-Path ".\cookie.txt")) {
    foreach ($user in (Get-Content ".\users.txt").Split(" ")) {
        Start-Job -Name $user -ScriptBlock {
            param ($user)
            .\gallery.exe -u ${user} -b $(Get-Content ./cookie.txt) -o "./Fix/" -t 5
        } -Args $user
    }
    Write-Output "所有任务已经提交，请耐心等待..."
    Get-Job
}
else {
    Write-Output "需要users.txt文件和cookie.txt文件!"
}
